package com.probox.common.core.enums;

import com.probox.common.core.utils.StringUtils;

/**
 * 客户购买状态
 * @author liuhj
 */
public enum CustomerPurchaseTypeEnum {

    purchasable("0","可购买"),
    toRenew("1","可续费"),
    doNotBuy("-1","不可购买");

    private CustomerPurchaseTypeEnum(String k, String v) {
        this.setKey(k);
        this.setValue(v);
    }

    public static String getNameByKey(String key) {
        String rst = "";
        if (StringUtils.isEmpty(key))
            return rst;
        for (com.probox.common.core.enums.CustomerServiceRoleEnum oe : com.probox.common.core.enums.CustomerServiceRoleEnum.values()) {
            if (oe.getKey().equals(key)) {
                rst = oe.getValue();
            }
        }
        return rst;
    }

    public String toString() {
        return this.getKey();
    }

    private String key;
    private String value;

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }
}
